#!/usr/bin/perl -w # useful for syntax highlighting

package clreqd_modules;

use Digest::SHA1;

sub sha1sum {
my %ARGS=@_;
my $file=$ARGS{FILE};

	if(! -e $file) {
		return "ERROR File '$file' does not exist.";
	}
	if(! -f $file) {
		return "ERROR File '$file' is not a regular file.";
	}

	my $fd;
	my $sha1=Digest::SHA1->new;
	open($fd,$file) or return "ERROR Failed to open file '$file'.";
	$sha1->addfile($fd);
	close($fd);
	return "OK " . $sha1->hexdigest;
}
1;
